<?php

/*
 * 商品模型
 * @author sky
 * create_time 2017-04-30
 */

namespace App\Admin\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Str;
use Intervention\Image\Constraint;
use Intervention\Image\Facades\Image;
use Illuminate\Support\Facades\Storage;

class Goods extends Model {

public $timestamps = false;
protected $table = 'mini_goods';

     /*
     * 添加商品
     * @author sky
     * create_time 2017-03-26
     */
    public static function addGoods($arr){
        Goods::insert($arr);
    }
    // 商品列表
    public static function goodsList(){
    	return Goods::get();
    }
    // 商品详情
    public static function goodsDetail($goodsid){
        return Goods::where("id", $goodsid)->get();
    }
     // 删除商品
    public static function goodsDeleted($goodsid){
    	return Goods::where("id", $goodsid)->delete();
    }
     // 修改商品
    public static function goodsUpdate($goodsid,$arr){
        return Goods::where('id',$goodsid)->update($arr);
    }
}
